<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="css/style.css" rel="stylesheet" type="text/css">

		<s:head theme="xhtml"/>
  		<sx:head parseContent="true"/>

		<title>维护所有的入库退货单主表</title>
		<script type="text/javascript">
			var link;
			function buyBackMainMod( link ) {
				var d = document.forms[0];
				d.action = link;
				d.submit();
			}

			function buyBackMainDel( link ) {
				if (window.confirm("确认删除吗？")) {
					var d = document.forms[0];
					d.action = link;
					d.submit();
				} else {

				}
			}

		</script>
	</head>

	<body>
		<center>
			<h2>
				维护所有的入库退货单主表
			</h2>
		</center>
		<div align="center">
			<form action="#" method="post">
				<s:textfield label="单号" name="buyBackMain.id" value="" size="6" />&nbsp;
				<s:select id="suppList" name="buyBackMain.suppId" label="供应商"
								  list="%{#request.allSupp}"
								  listKey="id" listValue="shortName" />&nbsp;
				<sx:datetimepicker label="退货日期" name="buyBackMain.buyBackDate"
							   displayFormat="yy-MM-dd" />&nbsp;
				<s:textfield label="经手人" name="buyBackMain.handler" size="8" />&nbsp;

				<input type="button" value="查询"     name="queryByCond" onclick="buyBackMainMod( 'selectBuyBackMainByCond' )" />&nbsp;
				<input type="button" value="查询全部" name="queryAll"    onclick="buyBackMainMod( 'queryAllBuyBackMain' )" />
					<!-- 借用一下 这个函数 -->

				<table border="1" width="80%">
					<tr>
						<th>单号</th>
						<th>供应商</th>
						<th>退货日期</th>
						<th>经手人</th>
						<th>结算方式</th>
						<th>操作员</th>
						<th>维护</th>

					</tr>
					<s:iterator value="#request.buyBackMainList" id="buyBackMain">
						<tr>
							<td>
								<s:property value="#buyBackMain.id" />
							</td>
							<td>
								<s:property value="#buyBackMain.suppName" />
							</td>
							<td>
								<s:property value="#buyBackMain.buyBackDate" />
							</td>
							<td>
								<s:property value="#buyBackMain.handler" />
							</td>
							<td>
								<s:property value="#buyBackMain.settleMode" />
							</td>
							<td>
								<s:property value="#buyBackMain.operator" />
							</td>
							<td>
								<input type="button" value="修改" name="update" onclick="buyBackMainMod('prepareModBuyBackMain?buyBackMainId=<s:property value="#buyBackMain.id" />')" />
								<input type="button" value="删除" name="delete" onclick="buyBackMainDel('deleteBuyBackMain?buyBackMainId=<s:property value="#buyBackMain.id" />')" />
								<input type="button" value="明细" name="detail" onclick="buyBackMainMod('queryAllBuyBackDetail?buyBackMainId=<s:property value="#buyBackMain.id" />')" />
							</td>
						</tr>
					</s:iterator>
				</table>
			</form>

			<br/>
			<a href="prepareAddBuyBackMain.action">新增</a>

		</div>
	</body>
</html>